﻿using log4net.Core;
using MongoDB.Bson;

namespace log4net.extension.mongo
{
    /// <summary>
    /// message 格式直接转化为Bson格式保存到mongo中
    /// </summary>
    public class BsonMongoAppender : MongoAppenderBase
    {
        protected override BsonDocument Convert(LoggingEvent loggingEvent)
        {
            BsonDocument doc = null;
            BsonDocument.TryParse(loggingEvent.RenderedMessage, out doc);
            return doc;
        }
    }
}
